package com.inspur.gs.sbssdl.database.rysj.rysj.front.loginuserinfo.voactions;

import com.alibaba.fastjson.JSON;
import com.inspur.edp.bef.api.lcp.ILcpFactory;
import com.inspur.edp.bef.api.lcp.IStandardLcp;
import com.inspur.edp.bff.spi.AbstractFSAction;
import com.inspur.edp.cef.entity.condition.EntityFilter;
import com.inspur.edp.cef.entity.condition.FilterCondition;
import com.inspur.edp.cef.entity.entity.IEntityData;
import io.iec.edp.caf.commons.utils.SpringBeanUtils;

import java.util.ArrayList;
import java.util.List;

public class getDeviceStatusVOAction extends AbstractFSAction<String> {

    public getDeviceStatusVOAction() {

    }

    @Override
    public void execute() {
        //设备状态beid
        String beId = "dfc4b012-c896-4b1f-9b84-d8f442042121";
        ILcpFactory lcpFactory = SpringBeanUtils.getBean(ILcpFactory.class);
        IStandardLcp lcp = lcpFactory.createLcpByBEId(beId);
        ArrayList<FilterCondition> list = new ArrayList<>();
        EntityFilter entityFilter = new EntityFilter();
        entityFilter.setFilterConditions(list);
        List<IEntityData> dataList = lcp.query(entityFilter);
        System.out.println(JSON.toJSONString(dataList));
        setResult(JSON.toJSONString(dataList));
    }


}
